package day4;

import java.util.Calendar;

/**
 * @author oldliu
 * @since 1.0
 */
public class CalTest {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar.getClass());
        System.out.println(calendar);
        System.out.println(calendar.getTime());
        int year=calendar.get(Calendar.YEAR);
        System.out.println(year);
        int month=calendar.get(Calendar.MONTH);
        System.out.println(month);
        int days=calendar.get(Calendar.DAY_OF_YEAR);
        System.out.println(days);
        //>>>add.role,set,,,
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        calendar.roll(Calendar.HOUR,100);
        System.out.println(calendar.getTime());

        calendar.set(Calendar.DAY_OF_MONTH,51);
        System.out.println(calendar.getTime());
        calendar.set(Calendar.YEAR,2020);
        int max=calendar.getActualMaximum(Calendar.DAY_OF_YEAR);
        System.out.println(max);
        int max2=calendar.getActualMaximum(Calendar.WEEK_OF_YEAR);
        System.out.println(max2);
        //当前月份：最大天数。。。
    }
}
